import Vue from 'vue'
import Router from 'vue-router'
import Home from '@/views/home.vue'
import Login from '@/views/login.vue'
import ShopList from '@/views/shop/shopList.vue'
import CarouselConfig from '@/views/configuration/carouselConfig.vue'
import ItemList from '@/views/order/itemList.vue'
import PostList from '@/views/forum/postList.vue'
import EditInfo from '@/views/userInfo/editInfo.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  routes: [
  {
    path: '/',
    name: '首页',
    component: Home,
    children: [
    {
      path: '/shop/shopList',
      name: '店铺列表',
      component: ShopList
    },
    {
      path: 'order/itemList',
      name: '商品订单列表',
      component: ItemList
    },
    {
      path: 'forum/postList',
      name: '帖子列表',
      component: PostList
    },
    {
      path: '/configuration/carouselConfig',
      name: '轮播配置',
      component: CarouselConfig
    },
    {
      path: '/userInfo/editInfo',
      name: '资料编辑',
      component: EditInfo
    }
    ]
  },
  {
    path: '/login',
    name: '登陆',
    component: Login
  }
  ]
})
